<?php
$db_member = pc_base::load_model('apply_expert_model');
$db_model_field = pc_base::load_model('model_field_model');
$SuperStar_field = pc_base::load_model('SuperStar_model');
$trade=$db_model_field->get_one('fieldid=396');
$trade['setting']=string2array($trade['setting']);

//$arr=explode('|',$trade['setting']['options']);
$arr = explode("\n",$trade['setting']['options']);
$arrs="";
foreach ($arr as &$v) {
	$arrss=explode('|',$v);
	$k=intval($arrss[1]);
	$arrs[$k]=$arrss[0];
}
//print_r($arrs);exit();
$arr='';
$arr=$arrs;
$trade=$db_model_field->get_one('fieldid=395');
$trade['setting']=string2array($trade['setting']);
//$arr=explode('|',$trade['setting']['options']);
$arr1 = explode("\n",$trade['setting']['options']);
$arrs1="";
foreach ($arr1 as &$v) {
	$arrss1=explode('|',$v);
	$k=intval($arrss1[1]);
	$arrs1[$k]=$arrss1[0];
}
//print_r($arrs);exit();
$arr1='';
$arr1=$arrs1;

$t=intval($_GET['t']);
$s=intval($_GET['s']);
$sql = " status=99";
if ($t!='') {
	$sql .=' and trade='.$t;
}
if ($s!='') {
	$sql .=" and type like '%".$s."%'";
}
$order='listorder desc';
$all=$SuperStar_field->select($sql,'*', '', $order);

?>
{template "content","header"}

<!-- header -->

<header class="header bgnone clearfix">
	<form action="{APP_PATH}" method="get" id="idx_search1" class="fl" onclick="?m=search&t=1&q=">
		<input type="hidden" name="m" value="search">
		<input type="hidden" name="t" value="1">
		<input type="hidden" name="type" value="2">
		<a class="txt1">搜索高见导师为您提供一对一的服务</a>
		<input type="submit" class="idx_submit" value="搜索">
	</form>
</header>
<!--  header -->

<!-- 焦点图 -->
<script type="text/javascript" src="{JS_PATH2}TouchSlide.js"></script>
<script type="text/javascript">
$(function() {
	TouchSlide({
		slideCell: "#slideBox",
		titCell: ".hd ul",
		mainCell: ".bd ul",
		effect: "leftLoop",
		autoPage: true,
		autoPlay: true
	});
});
</script>
<section id="slideBox" class="slideBox">
	<div class="bd">
		<ul class="bxslider">

{pc:content action="lists" catid="12" num="5" order="listorder asc"}
{loop $data $r}
			<li><a href="{$r[url]}"><img src="{$r[thumb]}"></a></li>
{/loop}
{/pc}
		</ul>
	</div>
	<div class="hd">
		<ul></ul>
	</div>
</section>
<!-- / 焦点图 -->
<!-- main -->
<main class="main">
	<ul class="navList1 clearfix">
		<li style="width:50%">
			<div class="nice-select">
				<input type="text" readonly value="行业分类" class="input1 j_down t">
				<div class="ul1" id="ul1">			
					<ul class="clearfix">
					<?php if($_GET['t']==''||$_GET['t']==0){?>				
					<li class="j_select on" data-type='free' data-value="0" style="width:100%">不限<!-- <em>2</em> --></li>
					<?php }else{?>
					<li class="j_select" data-type='free' data-value="0" style="width:100%">不限<!-- <em>2</em> --></li>
					<?php }?>
					{loop $arr $key $r}
					
					<?php 
						$SuperStar = pc_base::load_model('SuperStar_model');
						$count=$SuperStar->count('trade='.$n);
					?>
					<?php if($_GET['t']==$n){?>				
					<li class="j_select on" data-type='free' data-value="{$key}"><span>{$r}</span><em>{$count}</em></li>
					<?php }else{?>
					<li class="j_select" data-type='free' data-value="{$key}"><span>{$r}</span><em>{$count}</em></li>
					<?php }?>					
					{/loop}					
					</ul>
				</div>
			</div>
		</li>
		<!-- <li>		
			<div class="nice-select" id="w50">
				<input type="text" readonly="true" value="{if $_classtype!=0}{$_classtypeArr[$_classtype]['name']}{else}职业分类{/if}" class="input2 j_down">
				<ul class="ul1" id="ul50li">
					<li class="j_select{if $_classtype==0} on{/if}" data-type='classtype' data-value="0" style="width:100%;">全部</li>
{loop $_classtypeArr $r}
{if $r[parentid]==0}
					<li class="j_select{if $_classtype==$r[linkageid]} on{/if}" data-type='classtype' data-value="{$r[linkageid]}">{$r[name]}<em>{php echo $classtype_nums[$r[linkageid]] ? : 0}</em></li>
{/if}
{/loop}
				</ul>
			</div>		
		</li> -->
		<li style="width:50%">		
			<div class="nice-select">
				<input type="text" readonly="true" value="服务类型" class="input1 j_down s">
				<div class="ul1" id="ul2">
					<ul class="clearfix"> 
					<?php if($_GET['s']==''||$_GET['s']==0){?>				
					<li class="j_select on" data-type='free' data-value="0">不限</li>
					<?php }else{?>
					<li class="j_select" data-type='free' data-value="0">不限</li>
					<?php }?>
					{loop $arr1 $key $r}
					<?php if($_GET['s']==$n){?>				
					<li class="j_select on" data-type='free' data-value="{$key}">{$r}</li>
					<?php }else{?>
					<li class="j_select" data-type='free' data-value="{$key}">{$r}</li>
					<?php }?>
					{/loop}
					</ul>
				</div>
			</div>		
		</li>
	</ul>
	<div class="qianrends clearfix">
		<a href="http://igaojian.com/r/init" class="fl"><img src="{IMG_PATH2}icon/syyy_01.png"></a>
		<a href="javascript:;" class="fr" id="closed"><img src="{IMG_PATH2}icon/syyy_02.png"></a>
	</div>
	<script type="text/javascript">
	$(function(){
		$("#closed").click(function(){
			$(".qianrends").hide();
		});
	});
	</script>
	<ul class="oList_daoshi">

{loop $all $r}
		<li>
			<a href="{$r[url]}" class="clearfix">				
				<img src="{$r[thumb]}" class="oListdsImg fl">				
				<div class="oListdsCon">
					<div class="oListdsCon1 clearfix"><em class="fl">{$r[title]}</em>{$r[job]}
					</div>
					<div class="oListdsTxt ellipsis">{$r[con]}</div>
					<div class="yuejianzt clearfix">
					<?php
						$num=$db_member->count('a_id='.$r['id']);
						$passnum=$db_member->count('a_id='.$r['id'].' and status=1');
					?>
						<span class="icon_heart">{$num}人想约</span>
						<span class="icon_yyj">{$passnum}人成功预约</span>
					</div>
					<div class="ds_biaoqian clearfix">
					<?php if (strpos($r['type'], '1') !== false) {?>
				    <i class="icon_t"></i>
				    <?php }?>
				    <?php if (strpos($r['type'], '2') !== false) {?>
				    <i class="icon_j"></i>
				    <?php }?>
				    <?php if (strpos($r['type'], '3') !== false) {?>
				    <i class="icon_r"></i>
				    <?php }?>
						<em class="fr">
						<?php $arr=explode('、', $r[goodjob])?>
						{$arr[0]}
						</em>
					</div>
				</div>
			</a>
		</li>
{/loop}

	</ul>




	<!-- <div id="loading"></div> -->
	<div class="mesTipsonlinedk"></div>
</main>
<!-- / main -->

<style type="text/css">
.navList1 li .nice-select{background:url({IMG_PATH2}icon/down.png) no-repeat 80% 50%;background-size:8px;}
.navList1 li .nice-select input.j_down.on{background:#fff url({IMG_PATH2}icon/down2.png) no-repeat 80% 50%;background-size:8px;color:#32acdf;}

#ul1 li{
	width: 50%;
	display: block;
	float: left;
}
.navList1 ul{ background:#fff;}

</style>
<script type="text/javascript">

if($('#ul1 .on').attr('data-value')!=0){
	$('.t').val($('#ul1 .on span').html());
}
if($('#ul2 .on').attr('data-value')!=0){
	$('.s').val($('#ul2 .on').html());
}

var GET_PATH = '{GET_PATH}';
$(function() {
	//下拉选择
	var width1 = $(window).width();
	var height1 = $(document).height();
	$(".ul1").css({
		height: (height1 - 102) + "px",
		width: '100%',
		background: "url({IMG_PATH2}icon/bg40.png) repeat"
	});
	$('.j_down').click(function() {
		if($(this).hasClass('on')){
			$(this).removeClass('on');
			$(this).next().hide();
		}else{
			$('.j_down').removeClass('on');
			$(this).addClass('on');
			$('.ul1').hide();
			$(this).next().show();
		}
	})


	$('.ul1').click(function() {
		$('.j_down').removeClass('on').next().hide();
	});
	$('.j_select').click(function(){
		$(this).parent().find('.j_select').removeClass('on');
		$(this).addClass('on');
		var t=$('#ul1').find('.on').attr('data-value');
		var s=$('#ul2').find('.on').attr('data-value');		
		window.location.href="index.php?m=content&c=index&a=lists&catid=2&t="+t+"&s="+s;
	})
	
});
</script>
<div class="h_48"></div>

{template "content","footer_nav"}

{template "content","footer"}